<?php
class Index extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$data = array ();		
		$eM = new WebEnumModel ();
		
		$enums = apply_filter ( 'get_web_enums', array () );
		$data ['_enums_'] = $enums;
		foreach ( $enums as $enum => $enum_name ) {
			$enumsData = $eM->getEnums ( $enum );
			$data ['_enums'][$enum] = $enumsData ? $enumsData : array ();
		}		
		$data ['labels'] = array ('', 'label-success', 'label-warning', 'label-important', 'label-info', 'label-inverse' );		
		$data ['navi'] = 'enum';
		return new SmartyView ( $data, 'enum/Index' );
	}	
}